<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title></title>
  </head>
  <body>
    <div id="app">

      <ul>
        <li v-for="item in list" :key="item.id">
          <div class="title">
            {{item.title}}
          </div>
          <div class="info">
            <span>{{item.source}}</span>
            <span>{{item.time}}</span>
          </div>
          <div class="right">
            <img :src='item.img' alt="">
          </div>

         
        </li>
      </ul>

    </div>

    <script src="../js/vue.js"></script>
    <script src="https://cdn.bootcdn.net/ajax/libs/axios/0.21.1/axios.min.js"></script>
    <script>
      var app = new Vue({
        el: "#app",
        data: {
          list: "",
        },
        async created() {
          const res =  await axios.get("http://hmajax.itheima.net/api/news");
          console.log(res);
          this.list =res.data.data;
        },

        methods: {},
        computed: {},
      });
    </script>
  </body>
</html>
